<?php
namespace app\common\model;

use app\common\helper\RandStr;

/**
 * 第三方应用注册信息管理
 *
 * Class AppModel
 * @package app\common\model
 */
class AppModel extends Model {
    /**
     * 返回唯一标识应用ID
     *
     * @return string
     */
    public static function generatePlatId() {
        return strtoupper(RandStr::str_rand(2)) . RandStr::str_unique();
    }

    /**
     * 返回加密的密钥
     *
     * @param $key
     * @return string
     */
    public static function generatePlatSecret($key) {
        return md5($key . '_' . RandStr::str_unique()) . md5('/' . RandStr::str_rand(32));
    }



}